package com.woniuxy.service.impl;

import com.woniuxy.entity.Projects;
import com.woniuxy.dao.ProjectsDao;
import com.woniuxy.service.ProjectsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (Projects)表服务实现类
 *
 * @author makejava
 * @since 2021-05-15 14:52:38
 */
@Service("projectsService")
public class ProjectsServiceImpl implements ProjectsService {
    @Resource
    private ProjectsDao projectsDao;

    /**
     * 通过ID查询单条数据
     *
     * @param prjId 主键
     * @return 实例对象
     */
    @Override
    public Projects queryById(Integer prjId) {
        return this.projectsDao.queryById(prjId);
    }

    /**
     * 查询多条数据
     *
     * @param offset 查询起始位置
     * @param limit  查询条数
     * @return 对象列表
     */
    @Override
    public List<Projects> queryAllByLimit(int offset, int limit) {
        return this.projectsDao.queryAllByLimit(offset, limit);
    }

    /**
     * 新增数据
     *
     * @param projects 实例对象
     * @return 实例对象
     */
    @Override
    public int insert(Projects projects) {
        return this.projectsDao.insert(projects);
    }

    /**
     * 修改数据
     *
     * @param projects 实例对象
     * @return 实例对象
     */
    @Override
    public int update(Projects projects) {
        return this.projectsDao.update(projects);
    }

    /**
     * 通过主键删除数据
     *
     * @param prjId 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Integer prjId) {
        return this.projectsDao.deleteById(prjId) > 0;
    }

    @Override
    public List<Projects> selectAll() {
        List<Projects> projects = this.projectsDao.selectAll();
        return projects;
    }


    /**
     * Description : 查询所有的数据  <br/>
     * ChangeLog : 1. 创建 ( 20:39 [Hello Mr. Guo]);
     *
     * @return java.util.List<com.woniuxy.entity.Projects>
    */

    @Override
    public List<Projects> selects() {
        List<Projects> selects = this.projectsDao.selects();
        return selects;
    }


    @Override
    public List<Projects> queryAll(Projects project) {
        List<Projects> projects = this.projectsDao.queryAll(project);
        return projects;
    }


}
